<template>
  <div id="bottom-bar">
    <div class="bar-left bar-item">
      <div>
        <i class="iconfont icon-kefu"></i>
        <span class="text">客服</span>
      </div>
      <div>
        <i class="iconfont icon-dianpu"></i>
        <span class="text">店铺</span>
      </div>
      <div>
        <i class="iconfont icon-shoucang"></i>
        <span class="text">收藏</span>
      </div>
    </div>
    <div class="bar-right bar-item">
      <div class="cart" @click="addToCart">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    // 点击添加购物车
    addToCart() {
      this.$emit("addToCart");
    },
  },
};
</script>

<style lang="less" scoped>
@import "~assets/css/iconfont.css";
#bottom-bar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 49px;
  line-height: 49px;
  text-align: center;
  background-color: #fff;

  .bar-left,
  .bar-right {
    flex: 1;
    display: flex;
    div {
      flex: 1;
      display: flex;
      flex-direction: column;
      i {
        line-height: 30px;
        font-size: 26px;
      }
      span {
        line-height: 19px;
      }
      &:active {
        color: #ff8198;
      }
    }
    .cart:active {
      background-color: #fff;
      color: #fedd02;
    }
    .buy:active {
      background-color: #fff;
      color: #ff8198;
    }
  }
  .cart,
  .buy {
    font-weight: 500;
    font-size: 17px;
    color: #fff;
  }
  .cart {
    background-color: #fedd02;
  }
  .buy {
    background-color: #ff8198;
  }
}
</style>